Last chance! 50% off unlimited learning
Sale ends in
Density values of a Dirichlet distribution.
ddiri(x, a, logged = TRUE)
A matrix containing compositional data. This can be a vector or a matrix with the data.
A vector of parameters. Its length must be equal to the number of components, or columns of the matrix with the compositional data and all values must be greater than zero.
A boolean variable specifying whether the logarithm of the density values to be returned. It is set to TRUE by default.
A vector with the density values.
The density of the Dirichlet distribution for a vector or a matrix of compositional data is returned.
Ng Kai Wang, Guo-Liang Tian and Man-Lai Tang (2011). Dirichlet and related distributions: Theory, methods and applications. John Wiley \& Sons.
# NOT RUN {
x <- rdiri( 100, c(5, 7, 4, 8, 10, 6, 4) )
a <- diri.est(x)
f <- ddiri(x, a$param)
sum(f)
a
# }
Run the code above in your browser using DataLab